<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">用户列表</div>
                </div>

			<!-- <button style="width: 200px;"><a href="../../../yonghuadd.php">新增</a></button> -->
 <button style="width: 200px;"><a href="<?= url('view/yonghuadd')?>">新增</a></button>


                <div class="widget-body am-fr">
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>用户ID</th>
                                <th>微信头像</th>
                                <th>微信昵称</th>
                                <th>性别</th>
                                <th>国家</th>
                                <th>省份</th>
                                <th>城市</th>
                                <th>注册时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['user_id'] ?></td>
                                    <td class="am-text-middle">
                                        <a href="<?= $item['avatarUrl'] ?>" title="点击查看大图" target="_blank">
                                            <img src="<?= $item['avatarUrl'] ?>" width="72" height="72" alt="">
                                        </a>
                                    </td>
                                    <td class="am-text-middle"><?= $item['nickName'] ?></td>
                                    <td class="am-text-middle"><?= $item['gender'] ?></td>
                                    <td class="am-text-middle"><?= $item['country'] ?: '--' ?></td>
                                    <td class="am-text-middle"><?= $item['province'] ?: '--' ?></td>
                                    <td class="am-text-middle"><?= $item['city'] ?: '--' ?></td>
                                    <td class="am-text-middle"><?= $item['create_time'] ?></td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                               
									<?php
									$con = mysql_connect("localhost","root","root") or die("Could not connect !");
									     
										 $db = mysql_select_db("yoshop",$con);
										 
										 
										 $result=mysql_query("SELECT open_id,nickName,avatarUrl,gender,country,province,city,address_id,wxapp_id,create_time,update_time FROM yoshop_user");
										 
										 $i=0;
										 while($row = mysql_fetch_array($result))
										 {
										    echo " <tr>\n";
										    echo "					<td>".$row['open_id'] ."</td>\n";
										    echo "					<td>".$row['nickName'] ."</td>\n";
										    echo "					<td>".$row['avatarUrl']."</td>\n";
											echo "					<td>".$row['gender']."</td>\n";
											echo "					<td>".$row['country']."</td>\n";
											echo "					<td>".$row['province']."</td>\n";
											echo "					<td>".$row['city']."</td>\n";
											echo "			<td>".$row['create_time']."</td>\n";
										    echo "				</tr>\n";
									}
									mysql_close($con);
									 ?>
						
						
						
						

                            <?php endif; ?>
							

                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
						
                       
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

    });
</script>

